#!/usr/bin/python
# -*- coding: utf-8 -*-

import sys
import tqdm
from pathlib import Path
import numpy as np


input_dir = Path(sys.argv[1])
output_dir = Path(sys.argv[2])
output_dir.mkdir(parents=True, exist_ok=True)

for bin_path in tqdm.tqdm(input_dir.iterdir()):
	data = np.fromfile(bin_path, np.float32).astype(np.float16)
	save_path = output_dir / bin_path.name
	data.tofile(save_path)
